/*****************************************************************
 *   Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 ****************************************************************/
package org.epiphron;

/**
 * Class representing various settings 
 * that define level of validation
 */
public class ValidationLevel {
	/**
	 * Plain validation, as reasoner does it. Weakest validation
	 */
	public static final ValidationLevel PLAIN = new ValidationLevel(false, false, false);
	
	/**
	 * Plain validation plus Unique Name Assumption for objects
	 */
	public static final ValidationLevel UNA = new ValidationLevel(true, false, false);
	
	/**
	 * Validation with UNA+CWA. Strongest validation, gives maximum of errors
	 */
	public static final ValidationLevel UNA_CWA = new ValidationLevel(true, true, false);
	
	/**
	 * UNA+CWA+inferring. Does not report errors on "missed information", 
	 * but instead infers missing links in Java objects
	 */
	public static final ValidationLevel INFER = new ValidationLevel(true, true, true);
	
	/**
	 * Whether inferring on Java objects should be performed
	 */
	boolean infer;
	
	/**
	 * Whether Unique Name Assumption should be used
	 */
	boolean useUNA;
	
	/**
	 * Whether Closed World Assumption should be used
	 */
	boolean useCWA;
	
	public ValidationLevel(boolean _useUNA, boolean _useCWA, boolean _infer) {
		useUNA = _useUNA;
		useCWA = _useCWA;
		infer = _infer;
	}
	
	/**
	 * @return whether inferring on Java objects should be performed
	 */
	public boolean shouldInfer() {
		return infer;
	}
	
	/**
	 * @return whether Closed World Assumption should be used
	 */
	public boolean shouldUseCWA() {
		return useCWA;
	}
	
	/**
	 * @return whether Unique Name Assumption should be used
	 */
	public boolean shouldUseUNA() {
		return useUNA;
	}
}
